package com.galen.subscriber;

import com.galen.subscriber.server.SubscriberServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @author shuaiys
 * @version 1.0
 * @package com.galen.subscriber.server
 * @description spring boot启动类
 * @date 2020-03-04 16:28
 */
//@EnableAsync   // 异步不能保证消费顺序
@SpringBootApplication
public class SubscriberApplication {

    @Resource
    private SubscriberServer subscriberServer;

    private static SubscriberServer server;

    @PostConstruct
    private void init(){
        server = subscriberServer;
    }

    public static void main(String[] args){
        SpringApplication.run(SubscriberApplication.class, args);
        server.run();
    }
}
